<link rel="stylesheet" href="../addons/jy_chengedu/css/mobile.css?v=1">

<div class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">店铺设置</div>
        <div class="fui-header-right"></div>
    </div>
    <div class='fui-content navbar'>
        <div class="fui-list-group">
            <div class="fui-list">              
                <div class="fui-list-inner">
                    <div class="title">商城logo</div>
                </div>
				<a class="fui-list-media" ng-if="pagedata.item.logo">
					<img class="round" src="{{tomedia(pagedata.item.logo) || '../core/resource/images/nopic.jpg'}}" />
				</a>
				<a class="fui-list-media weui_uploader_input_wrp">
					<span class="weui_uploader_input" ng-click="image(pagedata.item,'logo')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple=""></span>
				</a>
            </div>
        </div>
       <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">机构名称</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="title" placeholder="机构名称" ng-model="pagedata.item.title"/></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">主营项目</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="例如鞋帽, 化妆品等" ng-model="pagedata.item.salecate"/></div>
            </div>
			<div class="fui-cell must ">
                <div class="fui-cell-label">机构分类</div>
				 <select class="weui_select" name="cateid2" ng-model="pagedata.item.cateid">
                        <option ng-repeat="q in pagedata.cate" value="{{q.id}}">{{q.catename}}</option>
                  </select>
            </div>
            <div class="fui-cell ">
                <div class="fui-cell-label">简单介绍</div>
                <div  class="fui-cell-info"><textarea id="desc" ng-model="pagedata.item.desc" placeholder="简单介绍下机构"></textarea></div>
            </div>
			<div class="weui_cells" style="margin-top:0">
			<div class="weui_cell weui_cell_switch">
						<div class="weui_cell_hd weui_cell_primary">需要制作?</div>
						<div class="weui_cell_ft">
							<input class="weui_switch" type="checkbox" ng-checked="pagedata.item.ismake" checked="checked" ng-model="pagedata.item.ismake">
						</div>
			</div>
			<div class="fui-cell-tip">开启后，机构有需要制作的过程，制作完成后，后台点发货，配送员才能接单！</div>
			<div class="weui_cell weui_cell_switch">
						<div class="weui_cell_hd weui_cell_primary">自己配送?</div>
						<div class="weui_cell_ft">
							<input class="weui_switch" type="checkbox" ng-checked="pagedata.item.mypeisong" checked="checked" ng-model="pagedata.item.mypeisong">
						</div>
			</div>
			</div>
			<div ng-if="pagedata.item.mypeisong" class="fui-cell must ">
                <div class="fui-cell-label">配送费</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.item.out_pay"/></div>
            </div>
			<div ng-if="pagedata.item.mypeisong" class="fui-cell must ">
                <div class="fui-cell-label">起送金额</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.item.out_price"/></div>
            </div>
			<div ng-if="pagedata.item.mypeisong" class="fui-cell must ">
                <div class="fui-cell-label">满额免配送费</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.item.man_fee"/></div>
            </div>
        </div>
		<div class="fui-cell-group">
			<div class="fui-cell">
                <div class="fui-cell-label">营业执照/许可证</div>
                <div class="fui-cell-info">
					<div class="weui_uploader">
                        <div class="weui_uploader_bd" style="margin-bottom:0">
                            <ul class="weui_uploader_files">
                                <li ng-repeat="p in pagedata.item.codeimg" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
									<div class="upbtn" >
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.item.codeimg.splice($index-1,0,p);pagedata.item.codeimg.splice($index+1,1)">上移</a>
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.item.codeimg.splice($index,1)">删除</a>
									</div>
								</li>
                            </ul>
                            <div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.item,'codeimg')"></div>
                        </div>
                    </div>
				</div>
            </div>
        </div>
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">联系人</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="realname" placeholder="您的称呼" ng-model="pagedata.item.realname"></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">手机号</div>
                <div class="fui-cell-info"><input type="tel" class="fui-input" id="mobile" placeholder="您的手机号" ng-model="pagedata.item.mobile"/></div>
            </div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>

        </div>
		<div class="fui-cell-group">
			<div class="fui-cell">
				<div class="fui-cell-label ">所在城市</div>		
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.item.pcd.province" class="form-control tpl-province">
								<option value="" selected="selected">省份</option>
								<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.item.pcd.province==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.item.pcd.city" class="form-control tpl-city">
								<option value="" selected="selected">城市</option>
								<option ng-repeat="(value,data) in pagedata.province[pagedata.item.pcd.province]" value="{{value}}" ng-selected="pagedata.item.pcd.city==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.item.pcd.district" class="form-control tpl-district">
								<option value="" selected="selected">区县</option>
								<option ng-repeat="(value,data) in pagedata.province[pagedata.item.pcd.province][pagedata.item.pcd.city]" value="{{value}}" ng-selected="pagedata.item.pcd.district==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.item.pcd.street" class="form-control tpl-district">
								<option value="" selected="selected">街道</option>
								<option ng-repeat="value in pagedata.province[pagedata.item.pcd.province][pagedata.item.pcd.city][pagedata.item.pcd.district]" value="{{value}}" ng-selected="pagedata.item.pcd.street==value">{{value}}</option>
								</select>
							</div>
				
			</div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">店铺地址</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="address" placeholder="店铺地址" ng-model="pagedata.item.address"></div>
				<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.item,'address','address')"><i class="icon jinyunicon icon-ditu"></i></div>
			</div>
            <label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding: 0.75rem 0.6rem 0.65rem;">选择坐标</label>
			<div class="col-xs-12 col-sm-8 col-lg-9">
						<div class="row row-fix">
							<div class="col-xs-4 col-sm-4">
								<input type="text" ng-model="pagedata.item.lat_lng.lng" placeholder="经度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<input type="text" ng-model="pagedata.item.lat_lng.lat" placeholder="纬度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<a ng-click="tool.choose_location(pagedata.item,'lat_lng','lat_lng')" class="btn btn-default btn-default-o btn-sm" type="button">选择坐标</a>
							</div>
						</div>
			</div>
        </div>
        <div class="btn btn-success block" ng-click="post(pagedata.item,'post')" id="btn-submit">保存设置</div>
   
    </div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<script type="text/javascript">
	window.scope.location(function(res){
			console.log(res)
			scope.$evalAsync(function(){
				scope.pagedata.item.lat_lng=scope.pagedata.item.lat_lng?scope.pagedata.item.lat_lng:res.lat_lng
				scope.pagedata.item.address = res.address;
			});
	});

</script>